Skip to content

Check the network access when deploying VM in Advanced Security Group.#6050

Merged
nvazquez merged 3 commits into
apache:4.16from
shapeblue:network-access-check-improvements
Mar 6, 2022
Merged

Check the network access when deploying VM in Advanced Security Group.#6050
nvazquez merged 3 commits into
apache:4.16from
shapeblue:network-access-check-improvements

Conversation

@sureshanaparti
Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti commented Mar 1, 2022

Description

This PR checks the network access when deploying VM in Advanced Security Group.

Fixes #6049

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  • Before fix, able to deploy VM with ROOT account, in Domain02 using network on Domain01 (in Advanced Security Group)
  • After fix, deploy VM failed with 'Unable to use network with id= 031a45f3-8522-4265-a145-6a647df20d27, permission denied'

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2734

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2735

@nvazquez
Copy link
Copy Markdown
Contributor

nvazquez commented Mar 1, 2022

@GabrielBrascher can you please review/test this fix?

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm !!

@weizhouapache
Copy link
Copy Markdown
Member

@sureshanaparti
can you also add my suggestion in comment #6049 (comment) to this PR ?

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3451)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39790 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6050-t3451-kvm-centos7.zip
Smoke tests completed. 83 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@sureshanaparti sureshanaparti added this to the 4.17.0.0 milestone Mar 2, 2022
@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@sureshanaparti
can you also add my suggestion in comment #6049 (comment) to this PR ?

@weizhouapache the access check for VM owner already exists here.

Account vmOwner = _accountMgr.getAccount(vmInstance.getAccountId());
_networkModel.checkNetworkPermissions(vmOwner, network);

so, the check against caller is still required here?

// Perform account permission check on network
_accountMgr.checkAccess(caller, AccessType.UseEntry, false, network);

@weizhouapache
Copy link
Copy Markdown
Member

so, the check against caller is still required here?

@sureshanaparti
then the 2nd check can be removed

@sureshanaparti sureshanaparti force-pushed the network-access-check-improvements branch from cc724ed to d64d936 Compare March 2, 2022 10:49
@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@GabrielBrascher
Copy link
Copy Markdown
Member

Thanks for the PR @sureshanaparti!
Is this ready to review or still in Draft?

I did a few tests applying your changes and seems to be working fine.
I will be running a few more tests but wanted to double-check if there is anything left for the PR.

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

Thanks for the PR @sureshanaparti! Is this ready to review or still in Draft?

I did a few tests applying your changes and seems to be working fine. I will be running a few more tests but wanted to double-check if there is anything left for the PR.

it is ready for review @GabrielBrascher

@sureshanaparti sureshanaparti marked this pull request as ready for review March 3, 2022 04:50
@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2753

@weizhouapache
Copy link
Copy Markdown
Member

@sureshanaparti
should this target to 4.16 ?

Copy link
Copy Markdown
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thanks @sureshanaparti, code LGTM.
Tested With Advanced Network + SG and now it is working as expected.

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@thanks @sureshanaparti, code LGTM.
Tested With Advanced Network + SG and now it is working as expected.

great, thanks for testing @GabrielBrascher

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@sureshanaparti
should this target to 4.16 ?

@weizhouapache this is targeted to 4.17

@weizhouapache
Copy link
Copy Markdown
Member

if there is 4.16.2.0 release, we need to backport this, right ?
why not target to 4.16 ?

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

if there is 4.16.2.0 release, we need to backport this, right ?
why not target to 4.16 ?

yes, may be when another minor release is needed on 4.16.

@apache apache deleted a comment from blueorangutan Mar 4, 2022
@nvazquez
Copy link
Copy Markdown
Contributor

nvazquez commented Mar 4, 2022

Agree with @weizhouapache - let's target the fix for branch 4.16 and merge forward to main

@nvazquez nvazquez force-pushed the network-access-check-improvements branch from d64d936 to fd28dd5 Compare March 4, 2022 16:57
@nvazquez nvazquez changed the base branch from main to 4.16 March 4, 2022 16:58
@nvazquez nvazquez force-pushed the network-access-check-improvements branch from fd28dd5 to fec436b Compare March 4, 2022 17:02
@nvazquez
Copy link
Copy Markdown
Contributor

nvazquez commented Mar 4, 2022

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2766

@nvazquez
Copy link
Copy Markdown
Contributor

nvazquez commented Mar 4, 2022

@blueorangutan test

Copy link
Copy Markdown
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blueorangutan
Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3496)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 36085 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6050-t3496-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez nvazquez merged commit 2820a36 into apache:4.16 Mar 6, 2022
@yadvr yadvr added the type:bug label Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

CloudStack allows deploying VMs on Networks that should not be accessed by VM's owner

6 participants